﻿
Imports runrroom.delegateClient

Public Module fakedDelegate
    Public Sub main(ByVal args() As String)
        errorHandle.initial(errorHandle.NOLOGFILEMARK)
        counter.initial(counter.NOCOUNTERFILEMARK)

        For i As Int64 = 0 To 100
            If rnd(0, 1) < 0.01 Then
                If Not updateStatus(percentage_t.FAILED) Then
                    raiseError("cannot update status to failed", errorHandle.errorType.warning)
                End If
                Exit For
            Else
                If Not updateStatus(New percentage_t(i)) Then
                    raiseError("cannot update status " + Convert.ToString(i), errorHandle.errorType.warning)
                End If
                sleepSeconds(rnd(1, 5, True))
            End If
        Next
    End Sub
End Module
